package com.peppa.service.combine.impl;

import com.peppa.entity.bo.HeadLine;
import com.peppa.entity.bo.ShopCategory;
import com.peppa.entity.dto.MainPageInfoDTO;
import com.peppa.entity.dto.Result;
import com.peppa.service.combine.HeadLineShopCategoryService;
import com.peppa.service.solo.HeadLineService;
import com.peppa.service.solo.ShopCategoryService;
import org.simpleframework.core.annotation.Service;
import org.simpleframework.inject.annotation.AutoWired;

import java.util.List;

@Service
public class HeadLineShopCategoryServiceImpl implements HeadLineShopCategoryService {
    @AutoWired
    private HeadLineService headLineService;
    @AutoWired
    private ShopCategoryService shopCategoryService;

    @Override
    public Result<MainPageInfoDTO> getMainPageInfo() {
        //获取头条列表
        HeadLine headLineCondition =new HeadLine();
        headLineCondition.setEnableStatus(1);
        Result<List<HeadLine>> headLineResult = headLineService.queryHeadLine(headLineCondition, 1, 4);
        //获取店铺类别列表
        ShopCategory shopCategoryCondition=new ShopCategory();
        Result<List<ShopCategory>>shopCategoryResult = shopCategoryService.queryShopCategory(shopCategoryCondition, 1, 100);
        //合并两者并返回
       Result<MainPageInfoDTO> result=  mergeMainPageInfoResult(headLineResult,shopCategoryResult);
       return  result;
    }

    private Result<MainPageInfoDTO> mergeMainPageInfoResult(Result<List<HeadLine>> headLineResult, Result<List<ShopCategory>> shopCategoryResult) {
            return null;
    }
}
